Configure generated applications for component scanning - #16111
Configure generated applications for component scanning#16111jamesfredley wants to merge 2 commits into
Conversation
Add base-package Spring component scanning to Forge and profile Application templates, with generated-source and runtime coverage. Closes #14914 Assisted-by: opencode:gpt-5.6-sol
There was a problem hiding this comment.
Pull request overview
Warning
Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.
Adds explicit Spring base-package component scanning to Forge-generated and profile-skeleton Grails applications, aligning generated Application classes and documenting the new default.
Changes:
- Add
@ComponentScanto generated and profile-skeletonApplicationclasses. - Update Forge tests to validate
@ComponentScanacross application types and verify standard Spring component injection. - Document the separation between Spring component scanning and Grails artefact scanning.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| grails-profiles/plugin/skeleton/grails-app/init/@grails.codegen.defaultPackage.path@/Application.groovy | Adds @ComponentScan to plugin profile skeleton. |
| grails-profiles/base/skeleton/grails-app/init/@grails.codegen.defaultPackage.path@/Application.groovy | Adds @ComponentScan to base profile skeleton. |
| grails-forge/test-core/src/test/groovy/org/grails/forge/create/CreateAppSpec.groovy | Parameterizes Application template assertions and adds an integration test validating Spring component scanning. |
| grails-forge/grails-forge-core/src/test/groovy/org/grails/forge/feature/lang/GrailsApplicationSpec.groovy | Asserts generated output includes @ComponentScan and validates profile skeleton templates. |
| grails-forge/grails-forge-core/src/main/java/org/grails/forge/feature/lang/groovy/application.rocker.raw | Emits @ComponentScan in the generated Application template. |
| grails-doc/src/en/guide/conf/applicationClass/customizing.adoc | Documents default Spring component scanning vs Grails artefact scanning. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Resolve profile templates independently of the test working directory and assert the generated test task outcome through Gradle TestKit. Assisted-by: opencode:gpt-5.6-sol
|
Not sure if adding component scanning is a good idea. It's definitely not needed for anything created by the app. The new bean dsl is a replacement for |
Summary
resources.groovyVerification
:grails-forge-core:check :test-core:check:grails-profiles-base:check :grails-profiles-plugin:check:grails-doc:publishGuide -x aggregateGroovydocGrailsApplicationSpec: 18 tests, 0 failuresCreateAppSpecgenerated-source matrix: 4 tests, 0 failuresCloses #14914